\(\int x (a+b \csc (c+d x^2)) \, dx\) [5]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 26 \[ \int x \left (a+b \csc \left (c+d x^2\right )\right ) \, dx=\frac {a x^2}{2}-\frac {b \text {arctanh}\left (\cos \left (c+d x^2\right )\right )}{2 d} \]

[Out]

1/2*a*x^2-1/2*b*arctanh(cos(d*x^2+c))/d

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {14, 4290, 3855} \[ \int x \left (a+b \csc \left (c+d x^2\right )\right ) \, dx=\frac {a x^2}{2}-\frac {b \text {arctanh}\left (\cos \left (c+d x^2\right )\right )}{2 d} \]

[In]

Int[x*(a + b*Csc[c + d*x^2]),x]

[Out]

(a*x^2)/2 - (b*ArcTanh[Cos[c + d*x^2]])/(2*d)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4290

Int[((a_.) + Csc[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Csc[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \int \left (a x+b x \csc \left (c+d x^2\right )\right ) \, dx \\ & = \frac {a x^2}{2}+b \int x \csc \left (c+d x^2\right ) \, dx \\ & = \frac {a x^2}{2}+\frac {1}{2} b \text {Subst}\left (\int \csc (c+d x) \, dx,x,x^2\right ) \\ & = \frac {a x^2}{2}-\frac {b \text {arctanh}\left (\cos \left (c+d x^2\right )\right )}{2 d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(57\) vs. \(2(26)=52\).

Time = 0.09 (sec) , antiderivative size = 57, normalized size of antiderivative = 2.19 \[ \int x \left (a+b \csc \left (c+d x^2\right )\right ) \, dx=\frac {a x^2}{2}-\frac {b \log \left (\cos \left (\frac {c}{2}+\frac {d x^2}{2}\right )\right )}{2 d}+\frac {b \log \left (\sin \left (\frac {c}{2}+\frac {d x^2}{2}\right )\right )}{2 d} \]

[In]

Integrate[x*(a + b*Csc[c + d*x^2]),x]

[Out]

(a*x^2)/2 - (b*Log[Cos[c/2 + (d*x^2)/2]])/(2*d) + (b*Log[Sin[c/2 + (d*x^2)/2]])/(2*d)

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00

method result size
norman \(\frac {a \,x^{2}}{2}+\frac {b \ln \left (\tan \left (\frac {d \,x^{2}}{2}+\frac {c}{2}\right )\right )}{2 d}\) \(26\)
parallelrisch \(\frac {a \,x^{2} d +b \ln \left (\tan \left (\frac {d \,x^{2}}{2}+\frac {c}{2}\right )\right )}{2 d}\) \(27\)
parts \(\frac {a \,x^{2}}{2}-\frac {b \ln \left (\csc \left (d \,x^{2}+c \right )+\cot \left (d \,x^{2}+c \right )\right )}{2 d}\) \(32\)
derivativedivides \(\frac {\left (d \,x^{2}+c \right ) a -b \ln \left (\csc \left (d \,x^{2}+c \right )+\cot \left (d \,x^{2}+c \right )\right )}{2 d}\) \(37\)
default \(\frac {\left (d \,x^{2}+c \right ) a -b \ln \left (\csc \left (d \,x^{2}+c \right )+\cot \left (d \,x^{2}+c \right )\right )}{2 d}\) \(37\)
risch \(\frac {a \,x^{2}}{2}+\frac {b \ln \left ({\mathrm e}^{i \left (d \,x^{2}+c \right )}-1\right )}{2 d}-\frac {b \ln \left ({\mathrm e}^{i \left (d \,x^{2}+c \right )}+1\right )}{2 d}\) \(48\)

[In]

int(x*(a+b*csc(d*x^2+c)),x,method=_RETURNVERBOSE)

[Out]

1/2*a*x^2+1/2*b/d*ln(tan(1/2*d*x^2+1/2*c))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.69 \[ \int x \left (a+b \csc \left (c+d x^2\right )\right ) \, dx=\frac {2 \, a d x^{2} - b \log \left (\frac {1}{2} \, \cos \left (d x^{2} + c\right ) + \frac {1}{2}\right ) + b \log \left (-\frac {1}{2} \, \cos \left (d x^{2} + c\right ) + \frac {1}{2}\right )}{4 \, d} \]

[In]

integrate(x*(a+b*csc(d*x^2+c)),x, algorithm="fricas")

[Out]

1/4*(2*a*d*x^2 - b*log(1/2*cos(d*x^2 + c) + 1/2) + b*log(-1/2*cos(d*x^2 + c) + 1/2))/d

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 42 vs. \(2 (20) = 40\).

Time = 2.57 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.62 \[ \int x \left (a+b \csc \left (c+d x^2\right )\right ) \, dx=\begin {cases} \frac {a \left (c + d x^{2}\right ) - b \log {\left (\cot {\left (c + d x^{2} \right )} + \csc {\left (c + d x^{2} \right )} \right )}}{2 d} & \text {for}\: d \neq 0 \\\frac {x^{2} \left (a + b \csc {\left (c \right )}\right )}{2} & \text {otherwise} \end {cases} \]

[In]

integrate(x*(a+b*csc(d*x**2+c)),x)

[Out]

Piecewise(((a*(c + d*x**2) - b*log(cot(c + d*x**2) + csc(c + d*x**2)))/(2*d), Ne(d, 0)), (x**2*(a + b*csc(c))/
2, True))

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.19 \[ \int x \left (a+b \csc \left (c+d x^2\right )\right ) \, dx=\frac {1}{2} \, a x^{2} - \frac {b \log \left (\cot \left (d x^{2} + c\right ) + \csc \left (d x^{2} + c\right )\right )}{2 \, d} \]

[In]

integrate(x*(a+b*csc(d*x^2+c)),x, algorithm="maxima")

[Out]

1/2*a*x^2 - 1/2*b*log(cot(d*x^2 + c) + csc(d*x^2 + c))/d

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.15 \[ \int x \left (a+b \csc \left (c+d x^2\right )\right ) \, dx=\frac {{\left (d x^{2} + c\right )} a + b \log \left ({\left | \tan \left (\frac {1}{2} \, d x^{2} + \frac {1}{2} \, c\right ) \right |}\right )}{2 \, d} \]

[In]

integrate(x*(a+b*csc(d*x^2+c)),x, algorithm="giac")

[Out]

1/2*((d*x^2 + c)*a + b*log(abs(tan(1/2*d*x^2 + 1/2*c))))/d

Mupad [B] (verification not implemented)

Time = 0.56 (sec) , antiderivative size = 69, normalized size of antiderivative = 2.65 \[ \int x \left (a+b \csc \left (c+d x^2\right )\right ) \, dx=\frac {a\,x^2}{2}-\frac {b\,\ln \left (-b\,x\,2{}\mathrm {i}-b\,x\,{\mathrm {e}}^{d\,x^2\,1{}\mathrm {i}}\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,2{}\mathrm {i}\right )}{2\,d}+\frac {b\,\ln \left (b\,x\,2{}\mathrm {i}-b\,x\,{\mathrm {e}}^{d\,x^2\,1{}\mathrm {i}}\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,2{}\mathrm {i}\right )}{2\,d} \]

[In]

int(x*(a + b/sin(c + d*x^2)),x)

[Out]

(a*x^2)/2 - (b*log(- b*x*2i - b*x*exp(d*x^2*1i)*exp(c*1i)*2i))/(2*d) + (b*log(b*x*2i - b*x*exp(d*x^2*1i)*exp(c
*1i)*2i))/(2*d)